package Exercise;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class Exercise06 {
    public static void main(String[] args) {
        Car1 car1 = new Car1(60.2);
        car1.getAir().flow();
        Car1 car2 = new Car1(-2);
        car2.getAir().flow();
        Car1 car3 = new Car1(18);
        car3.getAir().flow();


    }
}
class Car1{
    private double temperature;

    public Car1(double temperature) {
        this.temperature = temperature;
    }

    class Air{
        public void flow(){
            if(temperature > 40){
                System.out.println("空调吹冷风...");
            }
           else if(temperature < 0){
                System.out.println("空调吹暖气..");
            }
           else {
                System.out.println("温度正常，关闭空调");
            }
        }
    }

public Air getAir(){
        return new Air();
}

}
